Release 10.1A: OpenEdge Data Management:
DataServer for ODBC
ROWID function
The
ROWIDdata type provides a unique record identifier that is compatible across OpenEdge databases and ODBC data sources. Applications that use theROWIDfunction behave in the same way whether they access records in an OpenEdge database or in an ODBC data source. TheROWIDfunction is more consistent thanRECIDacross data sources. Progress Software Corporation recommends that you replace theRECIDfunction withROWIDin existing applications.The DataServer supports the
ROWIDfunction for ODBC data-source tables that have a unique index. The Data Dictionary uses an index that meets this criterion to provide values for theROWIDfunction. If you build your schema holder using OpenEdge compatibility from the Progress-to-ODBC utility, the Data Dictionary automatically designates aROWIDindex; however, you can select a different unique index in a data-source table to supportROWID. See the "Defining the ROWID" section for instructions.The
ROWIDvalue in an ODBC data source differs from theROWIDvalue in an OpenEdge database in the following ways:
- In Progress, you can create a
ROWIDwithout creating a record. In DataServer applications, creating aROWIDcreates a record. The following statement illustrates the difference in behavior:
The DataServer creates a
customerrecord using default values. After the user assigns values to the fields in that record, the DataServer updates it. When youUNDOthe transaction, the DataServer deletes the record.- The
ROWIDchanges if the value of the unique keys in the designated index changes.- The DataServer considers a single instance of the unknown value to be unique, so it is possible to have a
ROWIDwith the unknown value. However, the ProgressROWIDfunction fails if you search for an unknown value, because a ProgressROWIDwill never have the unknown value. For example, the followingFINDstatement fails even if there is a row with the unknown value in the designated column:
- If you force the creation of a record before entering the value for the designated column (for example, by committing a transaction or releasing or validating a record), the creation fails if the column cannot have
NULLvalues. If the column can haveNULLvalues, the DataServer assigns the new record aROWIDofNULL. However, if the column has an initial value, the DataServer creates the row with that initial value as theROWID.Follow these guidelines when using
ROWIDin applications that you want to deploy across multiple OpenEdge databases and/or ODBC data sources:
- Do not try to get a record’s
ROWIDvalue before the user assigns values to the unique keys of the record. Some DataServers use the unique key to generate aROWIDvalue.- Refresh the
ROWIDvalue if a value of a unique key might have changed.- Refresh the
ROWIDvalue after you undo aDELETE. TheROWIDvalue might be different after the record is re-created.ROWIDvalues are stable for a session, but you cannot rely on them to be the same across sessions.For a complete description of the
ROWIDfunction, see its reference entry in the OpenEdge Development: Progress 4GL Reference .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |